package com.hbut.bili.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hbut.bili.dao.VideoDao;
import com.hbut.bili.entity.Video;
import com.hbut.bili.service.IVideoService;

@Service
public class VideoServiceImpl implements IVideoService {
	
	@Autowired
	private VideoDao videoDao;
	
	/**
	 * 插入一条视频信息
	 * @param video
	 * @return
	 * @throws Exception
	 */
	@Override
	public Integer inserVideo(Video video) throws Exception {
		return videoDao.inserVideo(video);
	}
	
	/**
	 * 获取视频信息列表
	 * @return
	 * @throws Exception 
	 */
	@Override
	public List<Video> selectVideoList() throws Exception {
		return videoDao.selectVideoList();
	}
	
	
	/**
	 * 根据主键获得一条视频信息
	 * @param aid
	 * @return
	 * @throws Exception
	 */
	@Override
	public Video selectVideoById(Long aid) throws Exception {
		return videoDao.selectVideoById(aid);
	}
}
